#ifndef __SERIAL_H
#define __SERIAL_H

#include "main.h"
#include <stdio.h>
#include "usart.h"
#include "FreeRTOS.h"
#include "cmsis_os.h"


extern osSemaphoreId send_semHandle;
extern osSemaphoreId receive_semHandle;


int fputc(int c, FILE* file);
//void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart);
//void USAR_UART1_IDLECallback(void);

void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size);
int uart_recv_by_dmaToIdle(void* buf, int maxSize);
void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart);
int uart_send_by_dma(void *buf,int size);

#endif
